package br.com.assemble.hermeserp.model.pojos.pessoas;

import java.io.Serializable;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import br.com.assemble.hermeserp.ejb.annotation.DaoClass;
import br.com.assemble.hermeserp.model.BasePojo;
import br.com.assemble.hermeserp.model.pojos.comercial.Vendedor;
import br.com.assemble.hermeserp.model.pojos.controle.Usuario;
import br.com.assemble.hermeserp.model.pojos.enderecamento.Enderecamento;
import br.com.assemble.hermeserp.model.pojos.financeiro.EnderecoCobranca;


/**
 * The persistent class for the PESSOAS database table.
 * 
 */
@Entity
@Table(name="PESSOAS")
@DaoClass(value="PessoaDao", pu="hermes-pu")
public class Pessoa extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="PES_IDENTIFY", unique=true, nullable=false)
	private BigInteger pesIdentify;

	@Column(name="PES_COMPL_ENDERECO", length=50)
	private String pesComplEndereco;

	@Column(name="PES_DATA_CADASTRO", nullable=false)
	private Timestamp pesDataCadastro;

	@Column(name="PES_EMAIL", length=100)
	private String pesEmail;

	@Column(name="PES_NOME", nullable=false, length=100)
	private String pesNome;

	@Column(name="PES_NUMERO_ENDERECO")
	private Integer pesNumeroEndereco;

	@Column(name="PES_SITUACAO", length=1)
	private String pesSituacao;

	//bi-directional many-to-one association to Contato
	@OneToMany(mappedBy="pessoa")
	private List<Contato> contatoCollection;

	//bi-directional many-to-one association to EnderecoCobranca
	@OneToMany(mappedBy="pessoa")
	private List<EnderecoCobranca> enderecoCobrancaCollection;

	//bi-directional many-to-one association to Enderecamento
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="END_IDENTIFY")
	private Enderecamento enderecamento;

	//bi-directional one-to-one association to PessoaFisica
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PES_IDENTIFY", nullable=false, insertable=false, updatable=false)
	private PessoaFisica pessoaFisica;

	//bi-directional one-to-one association to PessoaJuridica
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PES_IDENTIFY", nullable=false, insertable=false, updatable=false)
	private PessoaJuridica pessoaJuridica;

	//bi-directional one-to-one association to Usuario
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PES_IDENTIFY", nullable=false, insertable=false, updatable=false)
	private Usuario usuario;

	//bi-directional many-to-one association to Vendedor
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="VEN_IDENTIFY", nullable=false)
	private Vendedor vendedor;

	//bi-directional many-to-one association to Telefone
	@OneToMany(mappedBy="pessoa")
	private List<Telefone> telefoneCollection;

    public Pessoa() {
    }

	public BigInteger getPesIdentify() {
		return this.pesIdentify;
	}

	public void setPesIdentify(BigInteger pesIdentify) {
		this.pesIdentify = pesIdentify;
	}

	public String getPesComplEndereco() {
		return this.pesComplEndereco;
	}

	public void setPesComplEndereco(String pesComplEndereco) {
		this.pesComplEndereco = pesComplEndereco;
	}

	public Timestamp getPesDataCadastro() {
		return this.pesDataCadastro;
	}

	public void setPesDataCadastro(Timestamp pesDataCadastro) {
		this.pesDataCadastro = pesDataCadastro;
	}

	public String getPesEmail() {
		return this.pesEmail;
	}

	public void setPesEmail(String pesEmail) {
		this.pesEmail = pesEmail;
	}

	public String getPesNome() {
		return this.pesNome;
	}

	public void setPesNome(String pesNome) {
		this.pesNome = pesNome;
	}

	public Integer getPesNumeroEndereco() {
		return this.pesNumeroEndereco;
	}

	public void setPesNumeroEndereco(Integer pesNumeroEndereco) {
		this.pesNumeroEndereco = pesNumeroEndereco;
	}

	public String getPesSituacao() {
		return this.pesSituacao;
	}

	public void setPesSituacao(String pesSituacao) {
		this.pesSituacao = pesSituacao;
	}

	public List<Contato> getContatoCollection() {
		return this.contatoCollection;
	}

	public void setContatoCollection(List<Contato> contatoCollection) {
		this.contatoCollection = contatoCollection;
	}
	
	public List<EnderecoCobranca> getEnderecoCobrancaCollection() {
		return this.enderecoCobrancaCollection;
	}

	public void setEnderecoCobrancaCollection(List<EnderecoCobranca> enderecoCobrancaCollection) {
		this.enderecoCobrancaCollection = enderecoCobrancaCollection;
	}
	
	public Enderecamento getEnderecamento() {
		return this.enderecamento;
	}

	public void setEnderecamento(Enderecamento enderecamento) {
		this.enderecamento = enderecamento;
	}
	
	public PessoaFisica getPessoaFisica() {
		return this.pessoaFisica;
	}

	public void setPessoaFisica(PessoaFisica pessoaFisica) {
		this.pessoaFisica = pessoaFisica;
	}
	
	public PessoaJuridica getPessoaJuridica() {
		return this.pessoaJuridica;
	}

	public void setPessoaJuridica(PessoaJuridica pessoaJuridica) {
		this.pessoaJuridica = pessoaJuridica;
	}
	
	public Usuario getUsuario() {
		return this.usuario;
	}

	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}
	
	public Vendedor getVendedor() {
		return this.vendedor;
	}

	public void setVendedor(Vendedor vendedor) {
		this.vendedor = vendedor;
	}
	
	public List<Telefone> getTelefoneCollection() {
		return this.telefoneCollection;
	}

	public void setTelefoneCollection(List<Telefone> telefoneCollection) {
		this.telefoneCollection = telefoneCollection;
	}
	
}